<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Groups extends Model
{

    protected $table = 'groups';

    protected $primaryKey = 'groupsID';

    public $timestamps = false;
    //白名单
    protected $fillable = [
        'groupsID',
        'name',
        'img',
        'description',
        'notice',
        'extend',
        'invites',
        'maxmember',
        'existing',
        'hx_id',
        'owner',
        'time',
        'img_oss',
    ];

    protected $casts = ['img'];

    public function getImgAttribute($value)
    {
        return \App\Library\HandleFile::handleFilePath($value, $this->img_oss);
    }
}
